import * as TYPES from '../action-type'
import api from '@/api'

const loginAction = {
    async [TYPES.LOGIN_POST](body) {
        let res = {}
        res = await api.loginPost(body)
        return ({ type: TYPES.LOGIN_POST, ...res })
    },
    async [TYPES.REGISTER_POST](body) {
        let res = {}
        res = await api.registerPost(body)
        return ({ type: TYPES.REGISTER_POST, ...res })
    },
    async [TYPES.CLEAR_USERINFO]() {
        return ({ type: TYPES.CLEAR_USERINFO, data: null    })

    },
}



export default loginAction;  